package com.example.hhhh.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.hhhh.R;

/**
 * @ProjectName: Hhhh
 * @Package: com.example.hhhh.fragment
 * @ClassName: BlankFragment
 * @Description: java类作用描述
 * @Author: songhua
 * @CreateDate: 2020/3/19 0019 17:05
 */
public class BlankFragment extends Fragment {

    private int index;

    public BlankFragment() {
        // Required empty public constructor
    }

    public static Fragment newInstance(int position) {
        BlankFragment fragment = new BlankFragment();
        fragment.index = position;
        return fragment;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_blank, container, false);
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        ((TextView) view.findViewById(R.id.textView)).setText("this Tab " + index);
    }
}
